home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Visual Basic Source Code
/
Visual Basic Source Code.iso
/
vbsource
/
arrang1g
/
led.ctl
next >
Wrap
Text File
|
1998-11-19
|
15KB
|
429 lines
VERSION 5.00
Object = "{6B7E6392-850A-101B-AFC0-4210102A8DA7}#1.2#0"; "COMCTL32.OCX"
Begin VB.UserControl LED
ClientHeight = 300
ClientLeft = 0
ClientTop = 0
ClientWidth = 300
ScaleHeight = 20
ScaleMode = 3 'Pixel
ScaleWidth = 20
ToolboxBitmap = "LED.ctx":0000
Begin VB.Timer Timer1
Enabled = 0 'False
Interval = 1000
Left = 1020
Top = 1500
End
Begin VB.Image Image1
Height = 300
Left = 0
Stretch = -1 'True
Top = 0
Width = 300
End
Begin ComctlLib.ImageList ImageList1
Left = 2100
Top = 1500
_ExtentX = 1005
_ExtentY = 1005
BackColor = -2147483643
ImageWidth = 20
ImageHeight = 20
MaskColor = 12632256
_Version = 327682
BeginProperty Images {0713E8C2-850A-101B-AFC0-4210102A8DA7}
NumListImages = 18
BeginProperty ListImage1 {0713E8C3-850A-101B-AFC0-4210102A8DA7}
Picture = "LED.ctx":0312
Key = "RedCirLo"
EndProperty
BeginProperty ListImage2 {0713E8C3-850A-101B-AFC0-4210102A8DA7}
Picture = "LED.ctx":0814
Key = "RedCirHi"
EndProperty
BeginProperty ListImage3 {0713E8C3-850A-101B-AFC0-4210102A8DA7}
Picture = "LED.ctx":0D16
Key = "GreCirLo"
EndProperty
BeginProperty ListImage4 {0713E8C3-850A-101B-AFC0-4210102A8DA7}
Picture = "LED.ctx":1218
Key = "GreCirHi"
EndProperty
BeginProperty ListImage5 {0713E8C3-850A-101B-AFC0-4210102A8DA7}
Picture = "LED.ctx":171A
Key = "RedSqeLo"
EndProperty
BeginProperty ListImage6 {0713E8C3-850A-101B-AFC0-4210102A8DA7}
Picture = "LED.ctx":1C1C
Key = "RedSqeHi"
EndProperty
BeginProperty ListImage7 {0713E8C3-850A-101B-AFC0-4210102A8DA7}
Picture = "LED.ctx":211E
Key = "GreSqeLo"
EndProperty
BeginProperty ListImage8 {0713E8C3-850A-101B-AFC0-4210102A8DA7}
Picture = "LED.ctx":2620
Key = "GreSqeHi"
EndProperty
BeginProperty ListImage9 {0713E8C3-850A-101B-AFC0-4210102A8DA7}
Picture = "LED.ctx":2B22
Key = "YelCirLo"
EndProperty
BeginProperty ListImage10 {0713E8C3-850A-101B-AFC0-4210102A8DA7}
Picture = "LED.ctx":3024
Key = "YelCirHi"
EndProperty
BeginProperty ListImage11 {0713E8C3-850A-101B-AFC0-4210102A8DA7}
Picture = "LED.ctx":3526
Key = "YelSqeLo"
EndProperty
BeginProperty ListImage12 {0713E8C3-850A-101B-AFC0-4210102A8DA7}
Picture = "LED.ctx":3A28
Key = "YelSqeHi"
EndProperty
BeginProperty ListImage13 {0713E8C3-850A-101B-AFC0-4210102A8DA7}
Picture = "LED.ctx":3F2A
Key = "ButtonUp"
EndProperty
BeginProperty ListImage14 {0713E8C3-850A-101B-AFC0-4210102A8DA7}
Picture = "LED.ctx":55A8
Key = "ButtonDown"
EndProperty
BeginProperty ListImage15 {0713E8C3-850A-101B-AFC0-4210102A8DA7}
Picture = "LED.ctx":6C26
Key = "KeyOff"
EndProperty
BeginProperty ListImage16 {0713E8C3-850A-101B-AFC0-4210102A8DA7}
Picture = "LED.ctx":A2D8
Key = "KeyOn"
EndProperty
BeginProperty ListImage17 {0713E8C3-850A-101B-AFC0-4210102A8DA7}
Picture = "LED.ctx":D98A
Key = "KeyOffwo"
EndProperty
BeginProperty ListImage18 {0713E8C3-850A-101B-AFC0-4210102A8DA7}
Picture = "LED.ctx":F2F4
Key = "KeyOnwo"
EndProperty
EndProperty
End
End
Attribute VB_Name = "LED"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = True
Attribute VB_PredeclaredId = False
Attribute VB_Exposed = False
'Default Property Values:
Const m_def_ButtonMode = 0
Const m_def_LEDColor = 0
Const m_def_Shape = 0
Const m_def_Value = False
'Property Variables:
Dim m_ButtonMode As enButtMode
Dim m_LEDColor As enLedColor
Dim m_Shape As LedShape
Dim m_Value As Boolean
'Event Declarations:
Event MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single) 'MappingInfo=Image1,Image1,-1,MouseDown
Attribute MouseDown.VB_Description = "Occurs when the user presses the mouse button while an object has the focus."
Event MouseUp(Button As Integer, Shift As Integer, X As Single, Y As Single) 'MappingInfo=Image1,Image1,-1,MouseUp
Attribute MouseUp.VB_Description = "Occurs when the user releases the mouse button while an object has the focus."
Event Click() 'MappingInfo=Image1,Image1,-1,Click
Enum LedShape
ledCircle = 0
ledSquare = 1
ledButton = 2
End Enum
Enum enLedColor
ledRed = 0
ledGreen = 1
ledYellow = 2
End Enum
Enum enButtMode
ledPushButton = 0
ledSwitch = 1
End Enum
Public Property Get LEDColor() As enLedColor
Attribute LEDColor.VB_Description = "Color of LED"
Attribute LEDColor.VB_ProcData.VB_Invoke_Property = ";Appearance"
Attribute LEDColor.VB_MemberFlags = "200"
LEDColor = m_LEDColor
End Property
Public Property Let LEDColor(ByVal New_LEDColor As enLedColor)
m_LEDColor = New_LEDColor
PropertyChanged "LEDColor"
Call Nastavi
End Property
Public Property Get Shape() As LedShape
Attribute Shape.VB_Description = "Shape of LED"
Attribute Shape.VB_ProcData.VB_Invoke_Property = ";Appearance"
Shape = m_Shape
End Property
Public Property Let Shape(ByVal New_Shape As LedShape)
m_Shape = New_Shape
PropertyChanged "Shape"
Call Nastavi
End Property
Public Property Get Value() As Boolean
Attribute Value.VB_ProcData.VB_Invoke_Property = ";Data"
Value = m_Value
End Property
Public Property Let Value(ByVal New_Value As Boolean)
m_Value = New_Value
PropertyChanged "Value"
Call Nastavi
End Property
Private Sub Timer1_Timer()
Static test As Boolean
If m_Shape = 0 Then
If m_LEDColor = 0 Then
If test = False Then
Image1.Picture = ImageList1.ListImages("RedCirLo").Picture
test = True
Else
Image1.Picture = ImageList1.ListImages("RedCirHi").Picture
test = False
End If
ElseIf m_LEDColor = 1 Then
If test = False Then
Image1.Picture = ImageList1.ListImages("GreCirLo").Picture
test = True
Else
Image1.Picture = ImageList1.ListImages("GreCirHi").Picture
test = False
End If
Else
If test = False Then
Image1.Picture = ImageList1.ListImages("YelCirLo").Picture
test = True
Else
Image1.Picture = ImageList1.ListImages("YelCirHi").Picture
test = False
End If
End If
ElseIf m_Shape = 1 Then
If m_LEDColor = 0 Then
If test = False Then
Image1.Picture = ImageList1.ListImages("RedSqeLo").Picture
test = True
Else
Image1.Picture = ImageList1.ListImages("RedSqeHi").Picture
test = False
E